<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 字符串方法</title>
</head>
<body>
<h2>提取字符串字符-charAt(position)</h2>
<p>charAt() 方法返回字符串中指定下标（位置）的字符串：</p>

<p id="demo"></p>

<script>
  var str = "HELLO WORLD";
  document.getElementById("demo").innerHTML = str.charAt(0);
</script>

</body>
</html>

<!--输出结果：H-->